<?xml version='1.0' encoding='UTF-8' ?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" 
    "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml"
      xmlns:h="http://java.sun.com/jsf/html"
      xmlns:f="http://java.sun.com/jsf/core" 
      xmlns:ui="http://java.sun.com/jsf/facelets" 
      xmlns:a4j="http://richfaces.org/a4j"
      xmlns:rich="http://richfaces.org/rich">

	<h:head>
		<title> Add or update employe</title>
	    <h:outputStylesheet>
	    </h:outputStylesheet>
	    <h:messages></h:messages>
	</h:head>
    <h:body>
    	<ui:composition template="/template/template.xhtml">
    	
    		<ui:define name="pageTitle">Employes >> Ajouter Employe </ui:define>
    		<br />
    	
    		
    	<ui:define name="content">
    		
    		  <h:form id="addupdatetable">
    		  
    			<table align="center" width="60%">
    							<tr>
		    							<td><h:outputLabel value="#{msg.lastName}"/></td>
		    							<td><h:inputText id="username" value="#{employeController.employeBean.nom}" 
		    							required="true" requiredMessage="champ obligatoire" validatorMessage="lenght not correct">
		    								<f:validateLength minimum="5" maximum="10" />
											</h:inputText>
											<h:message for="username"/>
		    							</td>
		    					</tr>
		    					<tr>
		    							<td><h:outputLabel value="Prenom"/></td>
		    							<td><h:inputText value="#{employeController.employeBean.prenom}"/></td>
		    					</tr>
		    					<tr>
		    							<td><h:outputLabel  value="Email"/></td>
		    							<td><h:inputText id="email" value="#{employeController.employeBean.email}" required="true"
		    							 requiredMessage="email obligatoire" validatorMessage="email not valid" >
		    							 <f:validator validatorId="com.cefolim.validator.EmailValidator"/>
										</h:inputText>
		    							<h:message for="email"></h:message>
		    							</td>
		    					</tr>
		    					<tr>
		    							<td><h:outputLabel value="Tel"/></td>
		    							<td><h:inputText value="#{employeController.employeBean.tel}"/></td>
		    					</tr>
		    					<tr>
		    							<td><h:outputLabel value="Date Naissance"/></td>
		    							<td>
		    								<rich:calendar id="dateStart"
												datePattern="dd/MM/yyyy"
												value="#{employeController.employeBean.dateNaiss}"
												dayStyleClass="disabledClassesProv" boundaryDatesMode="scroll"
												size="25" > 
											</rich:calendar>
		    							</td>
<!-- 		    							<td> -->
<!-- 		    								<h:inputText id="datepicker" value="#{employeController.employeBean.dateNaiss}"/> -->
<!-- 		    							</td> -->
		    					</tr>
		    					<tr>
		    							<td><h:outputLabel value="Salaire"/></td>
		    							<td><h:inputText value="#{employeController.employeBean.salaire}"/></td>
		    					</tr>
		    					<tr>
		    							<td><h:outputLabel value="Job"/></td>
		    							<td>
		    							<h:selectOneMenu value="#{employeController.employeBean.job}">
		    								<f:selectItem  value="#{employeController.employeBean.jobSelected}"/>
		    								<f:selectItems  value="#{employeController.listJob}" />
		    							</h:selectOneMenu>
		    							</td>
		    					</tr>
		    					<tr>
		    							<td><h:outputLabel value="Département"/></td>
		    							<td>
		    							<h:selectOneMenu value="#{employeController.employeBean.dep}">
		    								<f:selectItem  value="#{employeController.employeBean.depSelected}"/>
		    								<f:selectItems  value="#{employeController.listDep}" />
		    							</h:selectOneMenu>
		    							</td>
		    					</tr>
		    					
		    					<tr>
		    						<td width="60%"/>
		    						<td align="right">  
		    							<h:commandButton  value="Ajouter" action="#{employeController.saveOrUpdateEmploye}"  />
		    						</td>
		    					</tr>
		    	</table>
    						
			</h:form>
   		</ui:define>
    	</ui:composition>
    	
    </h:body>

</html>